import { BasicColumn } from '/@/components/Table/src/types/table';
import { FormSchema } from '/@/components/Form';

import { useI18n } from '/@/hooks/web/useI18n';

const { t } = useI18n();

export function myTaskColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.task.myTask.taskName'),
      dataIndex: 'newName',
      width: 200,
      align: 'center',
      fixed: 'left',
    },
    {
      title: t('routes.task.myTask.taskStatus'),
      dataIndex: 'newName',
      width: 150,
      align: 'center',
      fixed: 'left',
    },
    {
      title: t('routes.task.myTask.project'),
      dataIndex: 'tProject.name',
      width: 150,
      align: 'center',
      fixed: 'left',
    },
    {
      title: t('routes.task.myTask.projectManager'),
      dataIndex: 'tProject.managerName',
      width: 150,
      align: 'center',
      fixed: 'left',
    },
    {
      title: t('routes.task.myTask.remainingDays'),
      dataIndex: 'leftDays',
      width: 150,
      align: 'center',
      fixed: 'left',
    },
    {
      title: t('routes.task.myTask.planStartTime'),
      dataIndex: 'planStartTime',
      width: 150,
      align: 'center',
      fixed: 'left',
    },
    {
      title: t('routes.task.myTask.planEndTime'),
      dataIndex: 'planEndTime',
      width: 150,
      align: 'center',
      fixed: 'left',
    },
  ];
}

export const myTaskFormSchema: FormSchema[] = [
  {
    field: 'projectName',
    label: t('routes.task.myTask.projectName'),
    component: 'ApiSelect',
    componentProps: {
      placeholder: t('routes.task.myTask.projectPlaceholder'),
    },
    colProps: { span: 8 },
  },
  {
    field: 'projectManager',
    label: t('routes.task.myTask.projectManager'),
    component: 'ApiSelect',
    componentProps: {
      placeholder: t('routes.task.myTask.projectManagerPlaceholder'),
    },
    colProps: { span: 8 },
  },
  {
    field: 'taskStatus',
    label: t('routes.task.myTask.taskStatus'),
    component: 'ApiSelect',
    componentProps: {
      placeholder: t('routes.task.myTask.taskStatusPlaceholder'),
    },
    colProps: { span: 8 },
  },
  {
    field: 'startOrEndTime',
    label: t('routes.task.myTask.startOrEndTime'),
    component: 'RangePicker',
    colProps: { span: 8 },
  },
];
